﻿using Basic.HrRemoteModel;
using WeDonekRpc.Helper.Validate;

namespace Basic.HrGatewayModular.Model.EmpSign
{
    public class EmpSignAdd
    {
        [NullValidate("hr.emp.sign.name.null")]
        [LenValidate("hr.emp.sign.name.len", 1, 50)]
        public string SignName
        {
            get;
            set;
        }
        [LenValidate("hr.emp.sign.email.len", 0, 100)]
        [FormatValidate("hr.emp.sign.email.error", ValidateFormat.Email)]
        public string Email
        {
            get;
            set;
        }
        [EnumValidate("hr.emp.sign.encryption.type.error", typeof(HrCertEncryptionType), 0)]
        public HrCertEncryptionType EncryptionType
        {
            get;
            set;
        }
        [NullValidate("hr.emp.sign.pwd.null")]
        [LenValidate("hr.emp.sign.pwd.len", 6, 16)]
        public string CertPwd
        {
            get;
            set;
        }
        [LenValidate("hr.emp.sign.country.len", 0, 20)]
        public string Country
        {
            get;
            set;
        }
        [LenValidate("hr.emp.sign.company.len", 0, 20)]
        public string Company
        {
            get;
            set;
        }
        [LenValidate("hr.emp.sign.dept.len", 0, 20)]
        public string Dept
        {
            get;
            set;
        }

        public DateTime BeginTime { get; set; }
        /// <summary>
        /// 设定过期日期
        /// </summary>
        [TimeValidate("hr.emp.sign.end.time.error", TimeFormat.分, 0, false)]
        [TimeComparisonValidate("hr.emp.sign.end.time.compare", "BeginTime", NumComparisonType.大于等于)]
        public DateTime EndTime { get; set; }
    }
}
